#include <stdio.h>
#include <stdbool.h>
typedef struct YB{
	int price;
	int num;
	float  dj;
}YB;

void mySort(YB data[], int N)
{
	for(int i = 0; i < N; i++){
		bool flag = false;
		for(int j = i; j < N; j++){
			if((float)data[j].price / data[j].num < (float)data[j+1].price / data[j+1].num){
				int price = data[j+1].price;
				int num = data[j+1].num;
				float dj = data[j+1].dj;
				data[j+1].price = data[j].price;
				data[j+1].num = data[j].num;
				data[j+1].dj = data[j].dj;
				data[j].price = price;
				data[j].num = num;
				data[j].dj = dj;
				flag = true;
			}
		}
		if(!flag){
			break;
		}
	}
}

int main()
{
	int N = 0, D = 0 , i = 0;
	YB input[100] = {0};
	float sum = 0;
	scanf("%d %d", &N, &D);

	for(; i < N; i++){
		scanf("%d", &input[i].num);
	}

	for(i = 0; i < N; i++){
		scanf("%d", &input[i].price);
		input[i].dj = (float)input[i].price / input[i].num;
	}
	//排序，把单价高的排在前面
	mySort(input, N);

	for(i = 0; i< N; i++){
		if(input[i].num <= D){
			sum += (float)input[i].num * input[i].dj;	
			D -= input[i].num;
			continue;
		}else{
			sum += (float)D * input[i].dj;
			break;
		}
	}

	printf("%.2f\n", sum);
	return 0;
}
